package com.ruoyi.factorydata.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.*;

import java.util.Date;
import java.util.List;

/**
 * 出库单对象 stock_out_order
 *
 * @author ruoyi
 * @date 2025-08-26
 */
@Getter
@Setter
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(resultMap = "com.ruoyi.factorydata.mapper.StockOutOrderMapper.StockOutOrderResult")
public class StockOutOrder extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 出库单号
     */
    @Excel(name = "出库单号")
    private String orderNo;

    /**
     * 出库单类型
     */
    @Excel(name = "出库单类型")
    private String orderType;

    /**
     * 领料人ID
     */
    @Excel(name = "领料人ID")
    private Long requisitionUserId;

    /**
     * 出库时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "出库时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date outTime;

    /**
     * 出库状态(-1-已拒绝 0-待审批,2-已审批,3-已完成)
     */
    @Excel(name = "出库状态(-1-已拒绝 0-待审批,2-已审批,3-已完成)")
    private Integer status;

    /**
     * 版本号
     */
    @Excel(name = "版本号")
    @Version
    private Long version;

    /**
     * 删除标志（0代表存在 2代表删除）
     */
    @TableLogic(value = "0", delval = "2")
    private String delFlag;

    /**
     * 相关附件
     */
    @Excel(name = "相关附件")
    private String attachments;

    /**
     * 出库单详情
     */
    @TableField(exist = false)
    private List<StockOutOrderDetail> stockOutOrderDetailList;

    /**
     * 领料数量
     */
    @Excel(name = "领料数量")
    @TableField(exist = false)
    private Long requisitionQuantity;

    @Excel(name = "领料人")
    @TableField(exist = false)
    private String requisitionUserName;

    @TableField(exist = false)
    private String materialCode;

    @TableField(exist = false)
    private String materialName;

    @TableField(exist = false)
    private String updateByName;
}